applyAssetSourceAsset

abstract suspend fun applyAssetSourceAsset(sourceId: String, asset: Asset): DesignBlock?

Applies an asset to the active scene using custom AssetSource.applyAsset function.

Cancelling the coroutine stops the download that the engine's default apply waits for, and no block is created. An asset source with a custom AssetSource.applyAsset function keeps running: a block that it creates stays, and the call does not return it.

Return

the newly created block or null if no new block is created.

Parameters

sourceId

the sourceId of AssetSource which AssetSource.applyAsset function is going to be invoked.

asset

the asset to be applied to the active scene. Normally it's a single result of a findAssets query.


abstract suspend fun applyAssetSourceAsset(sourceId: String, asset: Asset, placement: AssetPlacement): DesignBlock?

Applies an asset to the active scene at the given placement. An asset source with a custom AssetSource.applyAsset function ignores the placement.

Cancelling the coroutine stops the download that the engine's default apply waits for, and no block is created. An asset source with a custom AssetSource.applyAsset function keeps running: a block that it creates stays, and the call does not return it.

Return

the newly created block or null if no new block is created.

Parameters

sourceId

the sourceId of AssetSource which AssetSource.applyAsset function is going to be invoked.

asset

the asset to be applied to the active scene. Normally it's a single result of a findAssets query.

placement

the parent block and the center position for the new block.


abstract suspend fun applyAssetSourceAsset(sourceId: String, asset: Asset, block: DesignBlock)

Applies an asset to the block using custom AssetSource.applyAsset function.

Parameters

sourceId

the sourceId of AssetSource which AssetSource.applyAsset function is going to be invoked.

asset

the asset that will be applied to the existing block. Normally it's a single result of a findAssets query.

block

the block that will be modified by the asset.